Public Class PRINT2
    Dim connect As CONDB = CONDB.NewConnection()
    Dim rpt1 As New DOCPRINT2
    Dim sql As String

    Public Sub New(ByVal _sql As String)

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        sql = _sql

    End Sub


    Private Sub PRINT_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Dim objSelectDatahis As New MASPRODUCT2
        Dim his As DataTable
        'his = connect.GetTable(objSelectDatahis.SelectHis2_)
        his = connect.GetTable(sql)

        rpt1.SetDatabaseLogon("root", "software")
        connect.Dispose()

        rpt1.SetDataSource(his)

        CrystalReportViewer1.ReportSource = rpt1
        CrystalReportViewer1.Refresh()
    End Sub

End Class